{cx:toolbar id="toolbar"}
{/cx:toolbar}
 
<!-- 表格 -->
<table id="table" data-toggle="gridview" class="table" data-url="/{$Request.module}/{$Request.controller}" data-toolbar="#toolbar" data-show-columns="true" data-page-size="10" data-page-list="[10, 25, 50, All]" data-unique-id="id" data-pagination="true" data-side-pagination="client">
    <thead>
		<tr>
			<th data-width="40" data-checkbox="true"></th>
			<th data-width="100" data-field="name">角色名称</th>
			<th data-width="100" data-field="status" data-formatter="format_status">状态</th>
			<th data-width="100" data-field="remark">备注</th>
		</tr>
	</thead>
</table>

<script type="text/javascript">
	function format_status(status, row, index) {
		if(status == 1){
			return '启用'
		}else if(status == 0){
			return '禁止'
		}
	}


	$(function(){
		$("#table").on("access_menu",function(e, gridview, params){
			if(gridview.currentRow == null){
				alertMsg("请先选择授权的用户！")
				return false;
			}
			params.data.id = gridview.currentRow.id
		})
	})
</script>


